<script setup lang="ts">
import { NButton, NSpace } from 'naive-ui'
import { useRouter } from 'vue-router'
const router = useRouter()

const toPage = (url: string) => {
  router.push(url)
}

const menus = [
  {
    text: '游戏发行商',
    url: '/crud/gamepublisher',
  },
  {
    text: '游戏',
    url: '/crud/game',
  },
  {
    text: '软件分类',
    url: '/software/softwaretype',
  },
  {
    text: '软件管理',
    url: '/software/software',
  },
  {
    text: '用户首页',
    url: '/user/main',
  },
  {
    text: '登录',
    url: '/user/login',
  },
  {
    text: '新闻客户端',
    url: '/news',
  },
  {
    text: '留言板',
    url: '/message',
  },
]
</script>

<template>
  <div class="fs-4 tc p-2">维亮的教学网站</div>
  <div class="p-4">
    <NSpace>
      <NButton v-for="menu in menus" :key="menu.url" @click="toPage(menu.url)">
        {{ menu.text }}
      </NButton>
    </NSpace>
  </div>
</template>
